package com.ssy.lingxi.member.merchant.model.vo.lrc.request;

import javax.validation.constraints.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * 会员升级规则配置 - 设置升级规则可获取的分值接口参数VO
 * @author 万宁
 * @version 2.0.0
 * @date 2020-08-24
 */
public class MemberLevelRuleConfigUpdateScoreVO implements Serializable {
    private static final long serialVersionUID = -7135094658330306979L;

    /**
     * 规则Id和参数数组
     */
    @NotEmpty(message = "规则Id和参数数组不能为空")
    private List<ScoreItem> items;

    public List<ScoreItem> getItems() {
        return items;
    }

    public void setItems(List<ScoreItem> items) {
        this.items = items;
    }

    public static class ScoreItem implements Serializable {
        private static final long serialVersionUID = 3099082306785653231L;

        /**
         * 升级规则Id
         */
        @NotNull(message = "升级规则Id要大于0")
        @Positive(message = "升级规则Id要大于0")
        private Long id;

        /**
         * 可获取的分值，如果是百分比，请传递百分比的分子
         */
        @NotNull(message = "获取的分值不能为空")
        @PositiveOrZero(message = "获取的分值要大于等于0")
        @Max(value = 1000000000, message = "获取的分值不能超过10的9次方")
        private BigDecimal score;

        public Long getId() {
            return id;
        }

        public void setId(Long id) {
            this.id = id;
        }

        public BigDecimal getScore() {
            return score;
        }

        public void setScore(BigDecimal score) {
            this.score = score;
        }
    }


}
